<?php
include('fonctions.php');

/* RECEIVE VALUE */
$validateValue = $_REQUEST['fieldValue'];
$validateId = $_REQUEST['fieldId'];

/* RETURN VALUE */
$arrayToJs = array();
$arrayToJs[0] = $validateId;

$arrayToJs[1] = true;
$result=tester_password($validateValue);

if ($result<50){
    $arrayToJs[2] = 'Facile <div class="progress-bar red"></div>';    
}elseif ($result>160){
    $arrayToJs[2] = 'Fort <div class="progress-bar green"></div>';  
}else{
    $arrayToJs[2] = 'Moyen <div class="progress-bar orange"></div>';    
}

echo json_encode($arrayToJs);
?>